package com.unchartedskies.controller.command
{
	import com.gamesmile.framework.util.Log;
	import com.unchartedskies.controller.event.PlayerIOEvent;
	import com.unchartedskies.model.State;
	import com.unchartedskies.model.value.StateConstant;
	
	import org.robotlegs.mvcs.Command;
	
	public class PlayerIOCommand extends Command
	{
	
		[Inject]
		public var event:PlayerIOEvent;
		
		[Inject]
		public var state:State;
		
		override public function execute():void
		{
			switch(event.type)
			{
				case PlayerIOEvent.CONNECTED:
					handleConnected();
				break;
				
				case PlayerIOEvent.CONNECTING:
				
				break;
				
				case PlayerIOEvent.ERROR:
				
				break;
			}
		}
		private function handleConnected():void
		{
			state.currentState = StateConstant.STATE_LOBBY;
		}
	}
}